package edu.hubu.talentmanagementsystem.model.ext;


import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableField;
import edu.hubu.talentmanagementsystem.model.Model;

import java.io.Serializable;

/**
 * <p>
 * 角色权限表
 * </p>
 *
 * @author moonlan
 * @since 2021-03-13
 */
@TableName("role_permission")
public class RolePermission extends Model<RolePermission> implements Serializable {


    /**
     * 角色权限ID
     */
    @TableId(value = "role_permission_id", type = IdType.AUTO)
    private Integer rolePermissionId;

    /**
     * 角色ID
     */
    @TableField("role_permission_role_id")
    private Integer rolePermissionRoleId;

    @TableField(exist = false)
    private Role role;

    /**
     * 权限ID
     */
    @TableField("role_permission_permission_id")
    private Integer rolePermissionPermissionId;

    @TableField(exist = false)
    private Permission permission;

    public Role getRole() {
        return role;
    }

    public RolePermission setRole(Role role) {
        this.role = role;
        return this;
    }

    public Permission getPermission() {
        return permission;
    }

    public RolePermission setPermission(Permission permission) {
        this.permission = permission;
        return this;
    }

    public Integer getRolePermissionId() {
        return rolePermissionId;
    }

    public RolePermission setRolePermissionId(Integer rolePermissionId) {
        this.rolePermissionId = rolePermissionId;
        return this;
    }

    public Integer getRolePermissionRoleId() {
        return rolePermissionRoleId;
    }

    public RolePermission setRolePermissionRoleId(Integer rolePermissionRoleId) {
        this.rolePermissionRoleId = rolePermissionRoleId;
        return this;
    }

    public Integer getRolePermissionPermissionId() {
        return rolePermissionPermissionId;
    }

    public RolePermission setRolePermissionPermissionId(Integer rolePermissionPermissionId) {
        this.rolePermissionPermissionId = rolePermissionPermissionId;
        return this;
    }

    @Override
    public String toString() {
        return "RolePermission{" +
                "rolePermissionId=" + rolePermissionId +
                ", rolePermissionRoleId=" + rolePermissionRoleId +
                ", rolePermissionPermissionId=" + rolePermissionPermissionId +
                "}";
    }
}
